Unix里输入"truss touch aaa"会输出什么?

来源:百度知道 编辑:UC知道 时间:2024/06/23 21:34:27
Unix里输入"truss touch aaa"会输出什么?
每一步是什么意思..

On a unix machine, run command “truss touch aaa” and get the output of the command, please explain what each step does. What are these fuctions? What is the function similar to “truss” on linux?

Solaris 命令
truss -c (Solaris >= 8):这是个令人震惊的 truss 选项,它提供了被追踪命令的全面概要信息:

$ truss -c grep asdf work.doc
syscall seconds calls errors
_exit .00 1
read .01 24
open .00 8 4
close .00 5
brk .00 15
stat .00 1
fstat .00 4
execve .00 1
mmap .00 10
munmap .01 3
memcntl .00 2
llseek .00 1
open64 .00 1
---- --- ---
sys totals: .02 76 4
usr time: .00
elapsed: .05

它还能显示正在运行的进程的概要数据。在本例中,数据表明了从启动 truss 命令到用 control-c 来终止 truss 执行的期间,进程到底做了些什么。这对于判断进程为何被挂起是很理想的,因为您无须费力浏览整个 truss 的输出。
truss -d 和 truss -D (Solaris >= 8):这两个选项表明与truss显示的每个系统调用相关的时间信息。这对于找出定制代码或商业代码中的问题很有帮助。例如:

$ truss -d who
Base time stamp: 1035385727.3460 [ Wed Oct 23 11:08:47 EDT 2002 ]
0.0000 execve("/usr/bin/who", 0xFFBEFD5C, 0xFFBEFD64) argc = 1
0.0032 stat("/usr/bin/who", 0xFFBEFA98) = 0
0.0037 open("/var/ld/ld.config&quo